package com.atguigu.gmall.controller;

import com.atguigu.gmall.bean.UserAddress;
import com.atguigu.gmall.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author yhl
 * @create 2021-08-10 16:06
 */

@Controller
public class OrderController {

    @Autowired
    OrderService orderService;

    @ResponseBody
    @GetMapping("/address")
    public UserAddress getAddress(@RequestParam("userId") String userId){
        return orderService.initOrder(userId);
    }

}
